/*
 * Created by: vadikv
 * Created: Thursday, March 06, 2008
 */

using System;
using System.Collections.Generic;
using fit;
using OneDayModel.Tests.Fits.Fixtures.Definitions;
using TestUtils;

namespace OneDayModel.Tests.Fits.Fixtures.Query
{
    public class UsersQueryFixture : RowFixture
    {
        public override object[] query()
        {
            List<UserDefinitionFixture> rawResult = new List<UserDefinitionFixture>();
            DefinitionExplorer<UserDefinitionFixture> usersExplorer = new DefinitionExplorer<UserDefinitionFixture>();
            for (int i = 0; i<usersExplorer.Count;i++)
                rawResult.Add(usersExplorer[i]);
            return rawResult.ToArray();
        }

        public static IDictionary<string, IList<string>> GetUserDefinitions()
        {
            IDictionary<string, IDictionary<string, IList<string>>> fixedDefinitions = ContextManager.TestContext.FixedDefinitions;
            string key = typeof(UserDefinitionFixture).Name;
            return fixedDefinitions.ContainsKey(key) ? fixedDefinitions[key] : null;
        }

        public override Type getTargetClass()
        {
            return typeof (UserDefinitionFixture);
        }
    }
}
